import {ref} from "@vue/reactivity";

export const l1InfoData = [
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "red",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "purple",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "orange",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "cyan",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "blue",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "red",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "red",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "red",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "red",
  },
  {
    text: "2020--07-03 15:23:13 李一鸣在天台停留超过15分钟",
    level: "red",
  },
].map((item) => new Array(3).fill(item)).flat(Infinity);

export const Ldata = ref([
  {
    title: "全部告警",
    type: "",
    dai: 0,
    zong: 0,
    color: "#69F3F8",
    key: "count"
  },
  {
    title: "异常人员告警",
    type: "5",
    dai: 0,
    zong: 0,
    color: "#C12A1E",
    key: "ycrl"
  },
  {
    title: "上网行为告警",
    type: "3",
    dai: 0,
    zong: 0,
    color: "#B575F5",
    key: "sw"
  },
  {
    title: "失联告警",
    type: "4",
    dai: 0,
    zong: 0,
    color: "#CFA162",
    key: "sl"
  },
  {
    title: "未归/晚归告警",
    type: "2",
    dai: 0,
    zong: 0,
    color: "#3B817E",
    key: "wg"
  },
  {
    title: "天台逗留告警",
    type: "1",
    dai: 0,
    zong: 0,
    color: "#699DF8",
    key: "tt"
  },

]);

export const r1EventColumn = [
  {
    name: "sj",
    title: "时间",
  },
  {
    name: "sbm",
    title: "告警设备",
  },
  {
    name: "xm",
    title: "当事人",
    arrow: true,
  },
  {
    name: "XH",
    title: "学号",
  },
  {
    name: "BJMC",
    title: "班级信息",
  },
  {
    name: "name",
    title: "事件详情",
  },
  {
    name: "cljg",
    title: "处理结果",
    arrowColor: true,
  },
  {
    name: "guard",
    title: "值班保安",
  },
  {
    name: "faceUrl",
    title: "安防记录",
    type: "image",
    width: 160,
    height: 90,
  },
];
export const r1KljColumn = [
  {
    name: "sj",
    title: "时间",
  },
  {
    name: "name",
    title: "地点名称",
  },
  {
    name: "allInNum",
    title: "最近进入",
  },
  {
    name: "allOutNum",
    title: "最近离开",
  },
  {
    name: "name",
    title: "事件详情",
  },
  {
    name: "dqrs",
    title: "当前人数",
  },
  {
    name: "dlsc",
    title: "逗留时长",
  },
  {
    name: "sjxq",
    title: "事件详情",
  },
  {
    name: "ztimg",
    title: "相关监控",
    type: "image",
    width: 160,
    height: 90,
  },
];

export const selectOp = [
  {
    value: "",
    label: "全部",
  },
  {
    value: "1",
    label: "晚归告警",
  },
  {
    value: "2",
    label: "未归告警",
  },
  {
    value: "3",
    label: "考勤后外出",
  },
];

export const r1EventData = (text) => [
  {
    date: "2023-4-18 13:55:49",
    device: "监控C1 - 1号宿舍楼正门",
    people: "陈哲宇",
    id: "12213123213131",
    classInfo: "2301",
    detail: "在1号宿舍附近徘徊逗留，风险告警",
    result: "已处理",
    guard: "李兆伟",
    record: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fss2.meipian.me%2Fusers%2F148754416%2F099ddbb0-27e0-11eb-9a40-17554453fb61.PNG%3Fmeipian-raw%2Fbucket%2Fivwen%2Fkey%2FdXNlcnMvMTQ4NzU0NDE2LzA5OWRkYmIwLTI3ZTAtMTFlYi05YTQwLTE3NTU0NDUzZmI2MS5QTkc%3D%2Fsign%2F9c8af33c4500936b3e9ba6201df78535.jpg&refer=http%3A%2F%2Fss2.meipian.me&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1685862075&t=b72e399d9c950a61366e502c004301d9",
    _title: "安防事件",
    _type: "red",
    _tag: {
      type: "fill-red",
      text: "异常人员",
    },
    _hexagon: {
      type: "blue",
      text: "未处理",
    },
    _buttons: [
      {
        type: "fill-blue",
        title: "发送",
      },
      {
        type: "fill-orange",
        title: "处理",
      },
    ],
  },
].map((item) => new Array(10).fill(item)).flat(Infinity).map((item, index) => ({
  ...item,
  _title: `${item._title}${index}`,
})).filter((item) => item._title.includes(text));
